﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CKS2320.Common.Model
{
    public class DataSetting
    {
        public KeyenceModel keyenceJson { get; set; }
        public OP10Model op10Json { get; set; }
        public OP20Model op20Json { get; set; }
        public OP30Model op30Json { get; set; }
        public OP00Model op00Json { get; set; }
        public SystemModel system { get; set; }
    }
    public class KeyenceModel
    {
        /// <summary>
        /// A件控制器
        /// </summary>
        public string IPA { get; set; } = string.Empty;
        /// <summary>
        /// B件控制器
        /// </summary>
        public string IPB { get; set; } = string.Empty;
        /// <summary>
        /// 端口号
        /// </summary>
        public int Proint { get; set; }
        /// <summary>
        /// 分片
        /// </summary>
        public int Fragmentation { get; set; }
        /// <summary>
        /// 超时时间
        /// </summary>
        public double Timeout { get; set; }
    }
    public class OP10Model
    {
        /// <summary>
        /// IP
        /// </summary>
        public string IP { get; set; } = string.Empty;
        /// <summary>
        /// PLC类型
        /// </summary>
        public string PLCType { get; set; } = string.Empty;
        /// <summary>
        /// 机架号
        /// </summary>
        public int Rack { get; set; }
        /// <summary>
        /// 槽号
        /// </summary>
        public int Slot { get; set; }
        /// <summary>
        /// 开始下载信号-心跳
        /// </summary>
        public string Heart1Offset { get; set; } = string.Empty;
        /// <summary>
        /// 开始下载信号
        /// </summary>
        public string StartUpLoad_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 开始下载信号
        /// </summary>
        public string StartUpLoad_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 工件编号
        /// </summary>
        public string PartCode_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 工件编号
        /// </summary>
        public string PartCode_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 工件编号触发
        /// </summary>
        public string PartCodeTrigger_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 工件编号触发
        /// </summary>
        public string PartCodeTrigger_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 结果
        /// </summary>
        public string Result_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 结果
        /// </summary>
        public string Result_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 已结束下载信号-心跳
        /// </summary>
        public string Heart2Offset { get; set; } = string.Empty;
        /// <summary>
        /// 已结束下载信号
        /// </summary>
        public string EndUpLoad_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 已结束下载信号
        /// </summary>
        public string EndUpLoad_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 工件编号结果 0初始化 1继续执行 2不执行
        /// </summary>
        public string PartCodeResult_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 工件编号结果 0初始化 1继续执行 2不执行
        /// </summary>
        public string PartCodeResult_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 检测数据开始
        /// </summary>
        public string DetectionDataStart_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 检测数据开始
        /// </summary>
        public string DetectionDataStart_BOffset { get; set; } = string.Empty;
    }
    public class OP20Model
    {
        /// <summary>
        /// IP
        /// </summary>
        public string IP { get; set; } = string.Empty;
        /// <summary>
        /// PLC类型
        /// </summary>
        public string PLCType { get; set; } = string.Empty;
        /// <summary>
        /// 机架号
        /// </summary>
        public int Rack { get; set; }
        /// <summary>
        /// 槽号
        /// </summary>
        public int Slot { get; set; }
        /// <summary>
        /// 开始下载信号-心跳
        /// </summary>
        public string Heart1Offset { get; set; } = string.Empty;
        /// <summary>
        /// 开始下载信号
        /// </summary>
        public string StartUpLoad_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 开始下载信号
        /// </summary>
        public string StartUpLoad_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 工件编号
        /// </summary>
        public string PartCode_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 工件编号
        /// </summary>
        public string PartCode_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 耐压检测
        /// </summary>
        public string VoltageWithstandResult_AOffset { get; set; } = string.Empty;
        public string VoltageWithstandResult_AOffsetAC { get; set; } = string.Empty;

        /// <summary>
        /// 耐压检测
        /// </summary>
        public string CameraDetectionResult_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 相机检测
        /// </summary>
        public string VoltageWithstandResult_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 耐压检测
        /// </summary>
        public string CameraDetectionResult_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 已结束下载信号-心跳
        /// </summary>
        public string Heart2Offset { get; set; } = string.Empty;
        /// <summary>
        /// 已结束下载信号
        /// </summary>
        public string EndUpLoad_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 已结束下载信号
        /// </summary>
        public string EndUpLoad_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 检测数据开始
        /// </summary>
        public string DetectionDataStart_AOffset { get; set; } = string.Empty;
        public string VoltageWithstandResult_BOffsetAC { get; set; } = string.Empty;
        /// <summary>
        /// 检测数据开始
        /// </summary>
        public string DetectionDataStart_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 总长
        /// </summary>
        public string TotalLengthResult_AOffset { get; set; } = string.Empty;
        public string TotalLengthResult_BOffset { get; set; } = string.Empty;

        public string BHVerticalityJudge_A { get; set; } = string.Empty;
        public string SHVerticalityJudge_A { get; set; } = string.Empty;
        public string BHVerticalityJudge_B { get; set; } = string.Empty;
        public string SHVerticalityJudge_B { get; set; } = string.Empty;
        public string Result_AOffset { get; set; } = string.Empty;
        public string Result_BOffset { get; set; } = string.Empty;
    }
    public class OP30Model
    {
        /// <summary>
        /// IP
        /// </summary>
        public string IP { get; set; } = string.Empty;
        /// <summary>
        /// PLC类型
        /// </summary>
        public string PLCType { get; set; } = string.Empty;
        /// <summary>
        /// 机架号
        /// </summary>
        public int Rack { get; set; }
        /// <summary>
        /// 槽号
        /// </summary>
        public int Slot { get; set; }
        /// <summary>
        /// 开始下载信号-心跳
        /// </summary>
        public string Heart1Offset { get; set; } = string.Empty;
        /// <summary>
        /// 3D激光扫描仪A开启
        /// </summary>
        public string StartKeyence_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 3D激光扫描仪B开启
        /// </summary>
        public string StartKeyence_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 3D激光扫描仪A结束
        /// </summary>
        public string EndKeyence_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 3D激光扫描仪B结束
        /// </summary>
        public string EndKeyence_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 开始下载信号A
        /// </summary>
        public string StartUpLoad_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 开始下载信号B
        /// </summary>
        public string StartUpLoad_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 工件编号
        /// </summary>
        public string PartCode_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 工件编号
        /// </summary>
        public string PartCode_BOffset { get; set; } = string.Empty;
        public string TotalLengthResult_AOffset { get; set; } = string.Empty;
        public string CrsmallEndDistanceResult_AOffset { get; set; } = string.Empty;
        public string CrlargeEndDistanceResult_AOffset { get; set; } = string.Empty;
        public string Crfront1WaveDistanceResult_AOffset { get; set; } = string.Empty;
        public string Crfront64WaveDistanceResult_AOffset { get; set; } = string.Empty;
        public string FrontThicknessResult1_AOffset { get; set; } = string.Empty;
        public string FrontThicknessResult2_AOffset { get; set; } = string.Empty;
        public string FrontThicknessResult3_AOffset { get; set; } = string.Empty;
        public string FrontThicknessResult4_AOffset { get; set; } = string.Empty;
        public string FrontThicknessResult5_AOffset { get; set; } = string.Empty;
        public string FrontThicknessResult6_AOffset { get; set; } = string.Empty;
        public string FrontThicknessResult7_AOffset { get; set; } = string.Empty;
        public string BackThicknessResult1_AOffset { get; set; } = string.Empty;
        public string BackThicknessResult2_AOffset { get; set; } = string.Empty;
        public string BackThicknessResult3_AOffset { get; set; } = string.Empty;
        public string BackThicknessResult4_AOffset { get; set; } = string.Empty;
        public string BackThicknessResult5_AOffset { get; set; } = string.Empty;
        public string BackThicknessResult6_AOffset { get; set; } = string.Empty;
        public string BackThicknessResult7_AOffset { get; set; } = string.Empty;
        public string SmallEndDirectionInspectionResult_AOffset { get; set; } = string.Empty;
        public string FacadeCurvatureResult_AOffset { get; set; } = string.Empty;
        public string TotalLengthResult_BOffset { get; set; } = string.Empty;
        public string CrsmallEndDistanceResult_BOffset { get; set; } = string.Empty;
        public string CrlargeEndDistanceResult_BOffset { get; set; } = string.Empty;
        public string Crfront1WaveDistanceResult_BOffset { get; set; } = string.Empty;
        public string Crfront64WaveDistanceResult_BOffset { get; set; } = string.Empty;
        public string FrontThicknessResult1_BOffset { get; set; } = string.Empty;
        public string FrontThicknessResult2_BOffset { get; set; } = string.Empty;
        public string FrontThicknessResult3_BOffset { get; set; } = string.Empty;
        public string FrontThicknessResult4_BOffset { get; set; } = string.Empty;
        public string FrontThicknessResult5_BOffset { get; set; } = string.Empty;
        public string FrontThicknessResult6_BOffset { get; set; } = string.Empty;
        public string FrontThicknessResult7_BOffset { get; set; } = string.Empty;
        public string BackThicknessResult1_BOffset { get; set; } = string.Empty;
        public string BackThicknessResult2_BOffset { get; set; } = string.Empty;
        public string BackThicknessResult3_BOffset { get; set; } = string.Empty;
        public string BackThicknessResult4_BOffset { get; set; } = string.Empty;
        public string BackThicknessResult5_BOffset { get; set; } = string.Empty;
        public string BackThicknessResult6_BOffset { get; set; } = string.Empty;
        public string BackThicknessResult7_BOffset { get; set; } = string.Empty;
        public string SmallEndDirectionInspectionResult_BOffset { get; set; } = string.Empty;
        public string FacadeCurvatureResult_BOffset { get; set; } = string.Empty;

        /// <summary>
        /// 已结束下载信号-心跳
        /// </summary>
        public string Heart2Offset { get; set; } = string.Empty;
        /// <summary>
        /// 已结束下载信号
        /// </summary>
        public string EndUpLoad_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 已结束下载信号
        /// </summary>
        public string EndUpLoad_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 3D扫描仪结果
        /// </summary>
        public string KeyenceResult_AOffset { get; set; } = string.Empty;
        /// <summary>
        /// 3D扫描仪结果
        /// </summary>
        public string KeyenceResult_BOffset { get; set; } = string.Empty;

        public string DetectionDataStart_AOffset { get; set; } = string.Empty;
        public string DetectionDataStart_BOffset { get; set; } = string.Empty;
        //开始握手信号
        public string ReadyKeyence_AOffset { get; set; } = string.Empty;
        public string ReadyKeyence_BOffset { get; set; } = string.Empty;

        //开始握手信号
        public string DirectioncheckA { get; set; } = string.Empty;
        public string DirectioncheckB { get; set; } = string.Empty;
        public string Result_AOffset { get; set; } = string.Empty;
        public string Result_BOffset { get; set; } = string.Empty;
        /// <summary>
        /// 结束3d A
        /// </summary>
        public string EndKeyence3dA { get; set; } = string.Empty;
        /// <summary>
        /// 结束3d B
        /// </summary>
        public string EndKeyence3dB { get; set; } = string.Empty;
        /// <summary>
        /// 结束保存A
        /// </summary>
        public string FinishSaveA { get; set; } = string.Empty;
        /// <summary>
        /// 结束保存B
        /// </summary>
        public string FinishSaveB { get; set; } = string.Empty;

        public string SC01ValueA { get; set; } = string.Empty;
        public string SC01ValueB{ get; set; } = string.Empty;
        public string SC02ValueA { get; set; }=string.Empty;
        public string SC02ValueB { get; set; } = string.Empty;
        public string SC03ValueA { get; set; } = string.Empty;
        public string SC03ValueB { get; set; } = string.Empty;

        public string SC04ValueA { get; set; } = string.Empty;
        public string SC04ValueB { get; set; } = string.Empty;
        /// <summary>
        /// 总长数据发送OK状态
        /// </summary>
        public string SendScValueOkA { get; set; } = string.Empty;
        public string SendScValueOkB { get; set; } = string.Empty;
    }

    public class OP00Model
    {
        /// <summary>
        /// IP
        /// </summary>
        public string IP { get; set; } = string.Empty;
        /// <summary>
        /// PLC类型
        /// </summary>
        public string PLCType { get; set; } = string.Empty;
        /// <summary>
        /// 机架号
        /// </summary>
        public int Rack { get; set; }
        /// <summary>
        /// 槽号
        /// </summary>
        public int Slot { get; set; }
    }

    public class SystemModel
    {
        public string webApiUrl { get; set; } = string.Empty;
    }
}
